﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>详细数据</title>
    <script src="../Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
    <link href="../Scripts/layui/layui/css/layui.css" rel="stylesheet" />
    <script src="../Scripts/layui/layui/layui.js" type="text/javascript"></script>
    <!--引入公共的JS-->
    <script src="../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../Scripts/config.js" type="text/javascript"></script>
    <script src="Gener.js" type="text/javascript"></script>
    <style type="text/css">
        .layui-table-tool{
            background-color:white;
        }
    </style>
    <script language="javascript" type="text/javascript">

        //页面启动函数.
        $(function () {

            $("#Msg").html("<img src='../Img/loading.gif' />正在加载, 请稍后......");
            InitPage();

            var titleName = GetQueryString("TitleName");
            if (titleName == null || titleName == undefined)
                titleName = "详情";

            document.title = titleName;


            $("#Msg").html("");
        });

        //初始化数据.
        function InitPage() {
            //创建处理器.
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Comm");
            handler.AddUrlData();  //增加参数.

            //获得map基本信息.
            var maindata = handler.DoMethodReturnString("ContrastDtl_Init");
            if (maindata.indexOf("err@") != -1) {
                alert(maindata);
                return;
            }
            maindata = JSON.parse(maindata);

            var Sys_MapAttrs = maindata["Sys_MapAttrs"];

            var Group_Dtls = maindata["Group_Dtls"];

            //获取标题名称
            var title = this.GetQueryString("TitleName");

            document.title = title;

            var columns = new Array();
            columns.push({
                type: "numbers",
                title: "序号",
            });
            for (var i = 0; i < Sys_MapAttrs.length; i++) {
                var attr = Sys_MapAttrs[i];

                if (attr.UIVisible == 0
                    || attr.KeyOfEn == "OID"
                    || attr.KeyOfEn == "WorkID"
                    || attr.KeyOfEn == "NodeID"
                    || attr.KeyOfEn == "MyNum"
                    || attr.KeyOfEn == "MyPK") {
                    keyOfEn = attr.KeyOfEn
                    continue;
                }


                var field = attr.KeyOfEn;
                var title = attr.Name;
                if (attr.UIContralType == 1)
                    field = field + "Text";
                if (attr.UIContralType == 2)
                    columns.push({
                        field: field,
                        title: title,
                        fixed: false,
                        formatter: function (value, row, index) {
                            if (value == "0") return "否";
                            if (value == "1") return "是";

                        }
                    });
                else
                    columns.push({
                        field: field,
                        title: title,
                        fixed: false

                    });
            }

            layui.use(['table', 'form'], function () {
                var table = layui.table;

                table.render({
                    elem: '#searchTable'
                    , data: Group_Dtls
                    , cellMinWidth: 80
                    , toolbar: 'true' //开启头部工具栏，并为其绑定左侧模板
                    , defaultToolbar: ['exports']
                    , title: '用户数据表'
                    , cols: [columns]
                    , page: false
                    , cellMinWidth: 60
                    , limit: Number.MAX_VALUE
                    , height: $(document).height() - $("#toolBar").height() - 100
                   
                });
            });
        }
    </script>
</head>
<body>
        <table class="layui-hide" id="searchTable" lay-filter="searchTable"></table>
</body>
</html>
